/*
  ID: nemokin1
  PROG: fracdec
  LANG: C++
*/
#include <vector>
#include <list>
#include <assert.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <fstream>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
 
using namespace std;
 
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=b;--i)
#define FOREACH(it,c) for(typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define ALL(c) (c).begin(),(c).end()
 
#define debug(x) cerr<< #x << " = " << (x) << "\n";
#define debugv(v) cerr << #v << " = "; FOREACH(it,v) cerr << *it <<","; cerr << "\n";
#define SIZE(a)  (int(a.size()))
 
template<typename T> inline void checkMax(T& a, T b) {if (b>a) a=b;}
template<typename T> inline void checkMin(T& a, T b) {if (b<a) a=b;}
 
typedef long long LL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef pair<int,int>  ii;
typedef long double ld;
const int INF = 1000000000;

int main() {
    freopen("fracdec.in","r",stdin);freopen("fracdec.out","w",stdout);
    int M,N;
    cin >> M >> N;
    int a1 = M/N;
    int p = M%N;
    int q = N;
    string a2;
    int cnt = 0;
    map<ii,int> m;
    
    for(;;){
	int t = p*10/q;
	int z = p*10%q;
	if(t == 0 && z == 0) break;
	if(m.count(ii(t,z)) == 0){
	    a2+=t+'0';
	    m[ii(t,z)] = cnt;
	    p = z;
	}
	else{
	    int kk = m[ii(t,z)];
	    a2.insert(kk,"(");
	    a2+=")";
	    break;
	}
	cnt++;
    }
    if(a2=="") a2 = "0";
    stringstream ss;
    ss << a1;
    string ret = ss.str();
    ret+=".";
    ret+=a2;
    for(int i = 0; i < ret.size(); i++){
	cout<<ret[i];
	if((i+1)%76 == 0) cout << endl;
    }
    if(ret.size()%76 != 0) cout << endl;
}

		
    

    

